package type.pets;

import java.util.List;

/**
 * @Date 2021/4/29 3:31 下午
 * @Author dengxin
 */
public class PetTest {

    public static void main(String[] args) {
//        PetsCreator petsCreator = new ForNameCreator();
//        List<Pet> petList = petsCreator.createPetList(10);
//        petList.forEach(pet -> System.out.println(pet.name));

        PetCreatorFacade petCreatorFacade = new PetCreatorFacade();
        List<Pet> petList = petCreatorFacade.createPetList(10);
        PetCounter petCounter = new PetCounter(Pet.class);
        petList.forEach(pet -> {
            try {
                petCounter.count(pet);
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println(pet.getName());
        });
        System.out.println(petCounter);
    }
}
